<div class="form__wrapper">
  <div class="card pt-4">

    <div class="card-section">
      <div class="row column">
        <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
      </div>

      <div class="row column">
        <%= form.translated :editor, :description, aria: { label: :description } %>
      </div>

      <% if @form.parent_id %>

        <div class="row column">
          <%= form.select :parent_id, parent_results.map { |result| [translated_attribute(result.title), result.id] }, include_blank: true %>
        </div>

      <% else %>

        <% if @form.taxonomy_filters&.any? %>
          <% @form.taxonomy_filters.each do |filter| %>
            <div class="row column">
              <%= filter_taxonomy_items_select_field form, :taxonomies, filter %>
            </div>
          <% end %>
        </div>
        <% end %>

      <% end %>

      <div class="row">
        <div class="columns">
          <%= form.date_field :start_date %>
        </div>

        <div class="columns">
          <%= form.date_field :end_date %>
        </div>
      </div>

      <% if @form.geocoding_enabled? %>
        <div class="row">
          <div class="columns">
            <%= form.geocoding_field(:address) %>
          </div>
        </div>
      <% end %>

      <div class="row">
        <div class="columns">
          <%= form.select :decidim_accountability_status_id, statuses.map { |status| [translated_attribute(status.name), status.id, { "data-progress" => status.progress }] }, include_blank: true %>
        </div>

        <div class="columns">
          <%= form.number_field :progress %>
        </div>
      </div>

    <% if Decidim.module_installed?(:proposals) %>
      <div class="row column">
        <%= render partial: "decidim/proposals/proposals/proposals_picker", locals: { form:, field: :proposals } %>
      </div>
    <% end %>

      <div class="row column">
        <% if @form.projects %>
          <%= form.select :project_ids,
                          @form.projects,
                          {},
                          { multiple: true, class: "chosen-select" } %>
        <% end %>
      </div>

    </div>
  </div>

</div>
